const id = location.search.substring(1)

const renderlist = async () => {
  const { data: res } = await axios.get(`/index/list?${id}`)
  // console.log(res)

  const dataArr = res.data.list.data

  $('.cat-leader h1').html(dataArr[0].catename)

  $('.new').html(dataArr.map(item => {
    return `
      <article class="excerpt excerpt-one">
            <header>
              <a class="cat label label-important" href="#/">热门<i class="label-arrow"></i></a>
              <h2>
                <a target="_self" href="show.html?${item.id}" title="阿里云拼团推荐服务器">${item.title}</a>
              </h2>
            </header>
            <p class="text-muted time">
              <a href="">${item.author}</a> 发布于 ${formatTime(item.create_date)}
            </p>
            <p class="focus">
              <a target="_blank" href="http://blog.weknow.cn/474.shtml" class="thumbnail">
                <span class="item"><span class="thumb-span"><img src="http://124.223.14.236:8060/${item.pic}"
                      class="thumb" /></span></span></a>
            </p>
            <p class="note">${item.description || ''}</p>
            <p class="text-muted views">
              <span class="post-views">阅读(${item.click || 0})</span>
              <span class="post-comments">评论(0)</span>
              <a href="javascript:;" class="post-like">
                <i class="fa fa-thumbs-up"></i>赞 (<span>${item.lovenum || 0}</span>)
              </a>
              <span class="post-tags">
                <a href="" rel="tag"></a>
                <a href="" rel="tag"></a></span>
            </p>
          </article>
      `
  }).join(''))



}
renderlist()